package tds.model7.version1;
/**
 * @Company 杭州先锋电子技术股份有限公司
 * @ClassName Decorator
 * @Description TODO（)
 * @author tds
 * @Date 2019/2/20 8:45
 * @version 1.0.0
 */
public abstract class Decorator extends Component{
    protected  Component component;

    /*
     * @Description (设置component)
     * @param [component]
     * @return void
     */
    public void setComponent(Component component) {
        this.component = component;
    }

    /*
     * @Description (重写operation方法，实际执行的是component的operation方法)
     * @param []
     * @return void
     */
    @Override
    public void operation() {
        if(component != null){
            component.operation();
        }
    }
}
